package helper.scxml.scxml2.t0.case2_traffic.zone.ts

import helper.base.debug.DebugHelper.DebuggerList.Companion.makeDebuggerList
import helper.scxml.scxml2.t0.case2_traffic.zone.TrafficEnvHelper.StrategyObj.aStart
import helper.scxml.scxml2.t0.case2_traffic.zone.TrafficEnvHelper.StrategyObj.car
import helper.scxml.scxml2.t0.case2_traffic.zone.TrafficEnvHelper.StrategyObj.getCarEasyEnvStrategy
import helper.scxml.scxml2.t0.case2_traffic.zone.ts.T0Helper.TaskUnit.Companion.getTaskUnit
import helper.scxml.strategy.TotalStrategyHelper.KREWTuple.Companion.makeKREWTuple
import helper.scxml.strategy.sNodeUnit.T2SNodeUnitHelper.ERT2SNodeUnit.Companion.makeL0ERT2SNodeUnit
import helper.scxml.strategy.sNodeUnit.T2SNodeUnitHelper.SubT2SNodeUnit.Companion.makeSubT2SNodeUnit
import helper.scxml.strategy.sNodeUnit.T2SNodeUnitHelper.T2SNodeUnit
import org.junit.Test

internal class T2_carEasy {
    fun getT2T2SNodeUnit(): T2SNodeUnit {
        return makeL0ERT2SNodeUnit(
            env = getCarEasyEnvStrategy(),
            ren = makeSubT2SNodeUnit().also {
                it.addSNode(
                    makeKREWTuple(aStart, 0..2, car, 1.0),
                )
            },
        )
    }

    private val taskUnit = getTaskUnit(getT2T2SNodeUnit())

    @Test
    fun t1() {
        taskUnit.repeatRandomRun(
            1000,
            makeDebuggerList(
            ),
        )
        //repeatTimes = 1000
        //average t = 20.987
    }

    @Test
    fun t3() {
        taskUnit.t1Cal()
        //result={t=21.0}
    }
}